/*
 * renderer.cpp
 *
 *  Created on: 12.04.2014
 *      Author: Ralph
 */

#include "renderer.h"
#include "../game/config.h"

#include <QGraphicsPixmapItem>

#include <QDebug>

Renderer::Renderer()
{
}

Renderer::~Renderer()
{
}

bool Renderer::init()
{
    // load tilesheet
    if( !loadTilesheet() )
    {
        qDebug() << "failed to load tilesheet";
        return false;
    }

    return true;
}

bool Renderer::loadTilesheet()
{
    QPixmap pixmapSrc;
    QGraphicsPixmapItem pixmap;

    bool loaded = pixmapSrc.load( Config::getInstance().get( "gfxPath" ).toString() + "/default.png" );

    pixmap.setPixmap( pixmapSrc );

    return loaded;
}
